var api = require('../../utils/api.js')



Page({

    /**
     * 页面的初始数据
     */
    data: {
        show:1,
        lists1:[],
        lists2:[],
        lists3:[],
        lists4:[],
        lists5:[],
        lists6:[],
        lists7:[],
        stat:'',
        endt:''
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad(options) {
        var that=this;

        api.get({
            url: 'index/getnowtime',
            data: {},
            success: data => {
                that.setData({
                    stat:data.data.a,
                    endt:data.data.b
                })
            }
        });
    },

    bindDateChangeb(ret){
        console.log(ret);
        this.setData({
            endt:ret.detail.value
        })
        this.getlist1();
        this.getlist2();
        this.getlist3();
        this.getlist4();
        this.getlist5();
        this.getlist6();
        this.getlist7();
    },

    bindDateChange(ret){
        console.log(ret);
        this.setData({
            stat:ret.detail.value
        })
        this.getlist1();
        this.getlist2();
        this.getlist3();
        this.getlist4();
        this.getlist5();
        this.getlist6();
        this.getlist7();
    },

    seelog(ret){
        console.log(ret);
        var i=ret.currentTarget.dataset.i;
        this.setData({
            show:i
        })
 
    },
    onShow(){

        this.getlist1();
        this.getlist2();
        this.getlist3();
        this.getlist4();
        this.getlist5();
        this.getlist6();
        this.getlist7();
    },

    getlist5(){
        var that=this;


        api.get({
            url: 'ranking/lists5',
            data: {stat:this.data.stat,endt:this.data.endt},
            success: data => {
                that.setData({
                    lists5:data.data
                })
            }
        });
    },

    getlist4(){
        var that=this;
        api.get({
            url: 'ranking/lists4',
            data: {stat:this.data.stat,endt:this.data.endt},
            success: data => {
                that.setData({
                    lists4:data.data
                })
            }
        });
    },

    getlist3(){
        var that=this;
        api.get({
            url: 'ranking/lists3',
            data: {stat:this.data.stat,endt:this.data.endt},
            success: data => {
                that.setData({
                    lists3:data.data
                })
            }
        });
    },
    getlist2(){
        var that=this;
        api.get({
            url: 'ranking/lists2',
            data: {stat:this.data.stat,endt:this.data.endt},
            success: data => {
                that.setData({
                    lists2:data.data
                })
            }
        });
    },

    getlist1(){
        var that=this;
        api.get({
            url: 'ranking/lists1',
            data: {stat:this.data.stat,endt:this.data.endt},
            success: data => {
                that.setData({
                    lists1:data.data
                })
            }
        });
    },
    getlist6(){
        var that=this;
        api.get({
            url: 'ranking/lists6',
            data: {stat:this.data.stat,endt:this.data.endt},
            success: data => {
                that.setData({
                    lists6:data.data
                })
            }
        });
    },
    getlist7(){
        var that=this;
        api.get({
            url: 'ranking/lists7',
            data: {stat:this.data.stat,endt:this.data.endt},
            success: data => {
                that.setData({
                    lists7:data.data
                })
            }
        });
    },
})